diff --git a/django/test/runner.py b/django/test/runner.py
index aba515e735..38cbae28dc 100644
--- a/django/test/runner.py
+++ b/django/test/runner.py
@@ -390,25 +390,30 @@ def parallel_type(value):
 
 _worker_id = 0
 
-
 def _init_worker(counter):
     """
-    Switch to databases dedicated to this worker.
+    Initialize the test database for the worker.
 
     This helper lives at module-level because of the multiprocessing module's
     requirements.
     """
-
     global _worker_id
 
+    # When using 'spawn' start method, we need to call django.setup() to
+    # initialize the Django framework and ensure the AppRegistry is populated.
+    import django
+    django.setup()
+
     with counter.get_lock():
         counter.value += 1
         _worker_id = counter.value
 
+    # Adjust the database name to include the worker ID.
     for alias in connections:
         connection = connections[alias]
-        connection.creation.setup_worker_connection(_worker_id)
-
+        test_db_name = connection.creation.get_test_db_clone_settings(_worker_id)['NAME']
+        connection.settings_dict['NAME'] = test_db_name
+        connection.creation.set_as_test_mirror(alias)
 
 def _run_subsuite(args):
     """
